<%= section_panel 'Deployment Summary', :width => 'double', :position => 'right' do %>
  <ul class="status">
    <li>
      <div class="marker">
        <%= deployment_state_icon(@deployment.deploymentState) %>
      </div>
      <div class="description">
        <ul>
          <li>
            <%= icon('info-circle', nil, 'fa-fw') %> deployment <%= highlight(@deployment.deploymentId) %> for
            release <%= link_to(highlight(@manifest.releaseId), path_to_release(@manifest)) %> is
            in <%= highlight(@deployment.deploymentState, @deployment.deploymentState) %> state
          </li>
          <li>
            <%= icon('user', nil, 'fa-fw') %> submitted <%= highlight(time_ago_in_words(@deployment.created_timestamp)) %>
            by <%= highlight(@deployment.createdBy, 'info') %>
          </li>
          <li>
            <%= icon('star', nil, 'fa-fw') %> has <b><%= @rfc_cis.size %></b> <%= 'work-order'.pluralize(@rfc_cis.size) %>
          </li>
          <% if @deployment.deploymentState == 'complete' %>
            <li>
              <%= icon('clock-o', nil, 'fa-fw') %> duration was
              <strong><%= time_duration_in_words((@deployment.updated_timestamp - @deployment.created_timestamp) * 1000) %></strong>
            </li>
          <% else %>
            <% if @deployment.updatedBy %>
              <li>
                <%= icon('arrow-circle-o-down', nil, 'fa-fw') %> <%= @deployment.deploymentState %>
                by <%= highlight(@deployment.updatedBy, 'info') %>
                <%= highlight(time_ago_in_words(@deployment.updated_timestamp)) %>
              </li>
            <% end %>
          <% end %>
          <% if @deployment.continueOnFailure %>
            <li><%= icon('exclamation', nil, 'fa-fw') %> <b>continue on failure</b> was requested</li>
          <% end %>
          <% if @deployment.comments.present? %>
            <li><%= icon('comment', nil, 'fa-fw') %> <%= sub_url_links(@deployment.comments) %></li>
          <% end %>
          <% if @deployment.ops.present? %>
            <li><%= icon('exclamation-triangle', nil, 'fa-fw') %> <%= @deployment.ops %></li>
          <% end %>
          <% if Rails.env.shared? || Rails.env.development? %>
            <li>
              <%= link_busy(button('View Deployment', nil, 'primary'),
                            :url    => edit_assembly_transition_environment_deployment_path(@assembly, @environment, @deployment),
                            :method => :get,
                            :busy   => 'Retrieving deployment plan...') %>
            </li>
          <% end %>
        </ul>
      </div>
    <li>
  </ul>
<% end %>
<%= section_panel 'Deployment Details', :width => 'double', :position => 'right' do %>
  <% if @state_history.present? %>
    <%= render 'state_history' %><br/>
  <% end %>
  <%= render 'cms/rfcs/rfc_list', :rfc_cis => @rfc_cis, :rfc_relations => @rfc_relations %>
<% end %>
